import React, { useRef, useState, useEffect } from "react";
// import { useScrolling } from "react-use";
import useScrolling from "../../hooks/customs/useScrolling";


const TestUseScrolling = () => {
  const scrollRef = useRef<HTMLDivElement>(null)
  const scrolling =  useScrolling(scrollRef)
  return (
    <>
    {<div>{scrolling ? "滚动中.." : "没有滚动"}</div>}

    <div ref={scrollRef} style={{height: '200px', overflow: 'auto'}}>
      <div>guang</div>
      <div>guang</div>
      <div>guang</div>
      <div>guang</div>
      <div>guang</div>
      <div>guang</div>
      <div>guang</div>
      <div>guang</div>
      <div>guang</div>
      <div>guang</div>
      <div>guang</div>
      <div>guang</div>
      <div>guang</div>
      <div>guang</div>
      <div>guang</div>
      <div>guang</div>
      <div>guang</div>
      <div>guang</div>
      <div>guang</div>
      <div>guang</div>
      <div>guang</div>
      <div>guang</div>
    </div>
    </>
  ); 
}

export default TestUseScrolling
